//
//  CHSHeaderTitleView.m
//  CAIAvoidCrash_Example
//
//  Created by 朱新明 on 2023/8/31.
//  Copyright © 2023 海参. All rights reserved.
//

#import "CHSHeaderTitleView.h"
#import <ZXCategoriesUtil/CAICategories.h>
#import <Masonry/Masonry.h>

@implementation CHSHeaderTitleView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self) {
        [self.contentView addSubview:self.titleLab];
        [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.contentView.mas_top);
            make.bottom.mas_equalTo(self.contentView.mas_bottom);
            make.left.mas_equalTo(self.contentView.mas_left).offset(15);
            make.centerX.mas_equalTo(self.contentView);
        }];
    }
    return self;
}


- (UILabel *)titleLab
{
    if (!_titleLab) {
        UILabel *lab = [[UILabel alloc] init];
        lab.font = [UIFont zx_boldSystemFontOfSize:14];
        lab.textColor = [UIColor blackColor];
        lab.numberOfLines = 0;
        lab.text = NSLocalizedString(@"", nil);
        _titleLab = lab;
    }
    return _titleLab;
}

@end
